Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix prometheus http_proxy using 0.0.0.0:80 #522

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

agrare
Copy link
Member

@agrare agrare commented Mar 5, 2024

When VMDB::Util.http_proxy_uri is nil VMDB::Util.http_proxy_uri.to_s is "".

With uri v0.10.3 URI.parse("http://") would have a host of nil but on v0.13.0 URI.parse("http://") has a host of "".

This was causing Faraday to use a proxy of 0.0.0.0:80 instead of none.

prometheus-api-client-0.6.2/lib/prometheus/api_client/client.rb:106:in 'rescue in run_command': Failed to open TCP connection to :80 (Connection refused - connect(2) for 0.0.0.0:80) (Prometheus::ApiClient::Client::RequestError)

When `VMDB::Util.http_proxy_uri` is `nil`
`VMDB::Util.http_proxy_uri.to_s` is `""`.

With uri v0.10.3 `URI.parse("http://")` would have a `host` of `nil` but
on v0.13.0 `URI.parse("http://")` has a `host` of `""`.

This was causing Faraday to use a proxy of `0.0.0.0:80` instead of none.
@Fryguy Fryguy self-assigned this Mar 5, 2024
@miq-bot
Copy link
Member

miq-bot commented Mar 5, 2024

Checked commit agrare@fb18d4b with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
2 files checked, 0 offenses detected
Everything looks fine. 🍪

@Fryguy Fryguy merged commit 22d854f into ManageIQ:master Mar 5, 2024
4 checks passed
@agrare agrare deleted the fix_prometheus_proxy_host branch March 5, 2024 19:46
@Fryguy
Copy link
Member

Fryguy commented Mar 5, 2024

Backported to radjabov in commit 2b36948.

commit 2b36948511009763d6a2b952e4d40e81c44dc670
Author: Jason Frey <[email protected]>
Date:   Tue Mar 5 14:46:29 2024 -0500

    Merge pull request #522 from agrare/fix_prometheus_proxy_host
    
    Fix prometheus http_proxy using 0.0.0.0:80
    
    (cherry picked from commit 22d854f19458ea441000d47ecfc13c6e473faf72)

Fryguy added a commit that referenced this pull request Mar 5, 2024
Fix prometheus http_proxy using 0.0.0.0:80

(cherry picked from commit 22d854f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants